// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import './static/vendor/mui/dist/css/mui.css'
import Axios from 'axios'
import './mock/index'
import './static/css/global.css'
import NavBar from '@/components/commons/navBar'
import Moment from 'moment'
import Vuex from 'vuex'
Vue.use(Vuex)
Vue.prototype.$ajax = Axios
Vue.use(MintUI)
Vue.config.productionTip = false
Vue.component('NavBar', NavBar)
Vue.filter('convertTime', function (value) {
  return Moment(value).format('YYYY-MM-DD')
})

// 创建store
var store = new Vuex.Store({
  state: {
    count: 0,
    ss: {
      selected: true
    }
  },
  mutations: {
    add (state) {
      state.count++
    },
    substract (state) {
      state.count -= 1
    }
  },
  getters: {
    up (state) {
      var o = {}
      o.selected = state.ss.selected
      return o
    }

  }
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: {
    App
  },
  template: '<App/>'
})
